<?php

namespace App\Admin\Controllers\OwnerItem;

use App\Models\HouseFeeConfig;
use App\Models\Owner;
use App\Models\OwnerItem;
use Dcat\Admin\Grid;
use Dcat\Admin\IFrameGrid;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Widgets\Alert;

// 已支付账单列表
class PayBillController extends CommonOwnerItemController
{
    public function index(Content $content)
    {
        if (request(IFrameGrid::QUERY_NAME)) {
            return $content->perfectScrollbar()->body($this->iFrameGrid());
        }

        $info = '<i class="fa fa-exclamation-circle"></i> 由于这是测试版，没有接入任何api, 所有的已经付款订单都只能由运营手动变更状态(后期可以接入api, 让系统更加的智能)';
        return $content
            ->title($this->title())
            ->description($this->description()['index'] ?? trans('admin.list'))
            ->body(Alert::make($info)->info())
            ->body($this->grid());
    }

    protected $title = "已收账单";

    protected function customGrid(Grid $grid)
    {
    }

    protected function customDetail($show)
    {
    }

    protected function map(): array
    {
        return [
            ['pay_at', '!=', null]
        ];
    }
}
